home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
C/C++ Users Group Library 1996 July
/
C-C++ Users Group Library July 1996.iso
/
listings
/
v_07_06
/
v7n6050a.txt
< prev
next >
Wrap
Text File
|
1989-07-23
|
1KB
|
43 lines
Listing 1
/*
plot() = plots a point on the screen at designated
system coordinates using selected color.
*/
void plot(int x, int y, int color)
{
#define seq_out(index,val) {outp(0x3C4,index);\
outp(0x3C5,val);}
#define graph_out(index,val) {outp(0x3CE,index);\
outp(0x3CF,val);}
unsigned int offset;
int dummy,mask,page;
char far * mem_address;
offset = (long)y * 80L + ((long)x / 8L);
mem_address = (char far *) 0xA0000000L + offset;
mask = 0x80 >> (x % 8);
graph_out(8,mask);
seq_out(2,0x0F);
dummy = *mem_address;
*mem_address = 0;
seq_out(2,color);
*mem_address = 0xFF;
seq_out(2,0x0F);
graph_out(3,0);
graph_out(8,0xFF);
}